from PyQt4 import QtGui, QtCore; #@UnusedImport

class Settings_StatusType(QtCore.QObject):    
    def __init__(self, parent):
        super(Settings_StatusType, self).__init__();
        self.parent = parent;
        self.mainWin = parent.mainWin;
        self.graphScene = parent.graphScene;
        self.createSettings_StatusType();
        
    def onLbxStateClick(self):
        iVal = self.lbxState.currentRow();
        self.graphScene.graphView.setNodes_StyleStatus(iVal);
        
    def onLbxActionClick(self):
        iVal = self.lbxAction.currentRow();
        self.graphScene.graphView.setActions_StyleStatus(iVal);
        
    def createSettings_StatusType(self):
        self.lblState = QtGui.QLabel("State:", self.mainWin);
        self.lblAction = QtGui.QLabel("Action:", self.mainWin);
        self.lbxState = QtGui.QListWidget(self.mainWin);
        self.lbxState.addItems(["Normal", "Current", "Fatal", "Goal"]);
        self.lbxState.connect(self.lbxState, 
                              QtCore.SIGNAL("itemSelectionChanged()"), 
                              self.onLbxStateClick);
        self.lbxState.setMaximumWidth(100);
        self.lbxState.setMaximumHeight(80);
        self.lbxAction = QtGui.QListWidget(self.mainWin);
        self.lbxAction.addItems(["Normal", "Current", "Risky", "Best"]);
        self.lbxAction.connect(self.lbxAction, 
                               QtCore.SIGNAL("itemSelectionChanged()"), 
                               self.onLbxActionClick);
        self.lbxAction.setMaximumWidth(100);
        self.lbxAction.setMaximumHeight(80);
        
        self.gridLayout = QtGui.QGridLayout();
        self.gridLayout.addWidget(self.lblState,0,0, 
                                  QtCore.Qt.AlignTop | QtCore.Qt.AlignRight);        
        self.gridLayout.addWidget(self.lbxState,0,1, QtCore.Qt.AlignLeft);        
        self.gridLayout.addWidget(self.lblAction,1,0, 
                                  QtCore.Qt.AlignTop | QtCore.Qt.AlignRight);
        self.gridLayout.addWidget(self.lbxAction,1,1, QtCore.Qt.AlignLeft);
        
        self.qWidget = QtGui.QWidget(self.mainWin);
        self.qWidget.setLayout(self.gridLayout);
        self.vBoxMain = QtGui.QVBoxLayout();
        self.vBoxMain.addWidget(self.qWidget);
        
    #Graph - StatusType Cmds
#    def setStatusTypeSt_Normal(self):
#        self.graphScene.graphView.setNodes_StyleStatus(0);
#    def setStatusTypeSt_Current(self):
#        self.graphScene.graphView.setNodes_StyleStatus(1);
#    def setStatusTypeSt_Fatal(self):
#        self.graphScene.graphView.setNodes_StyleStatus(2);
#    def setStatusTypeSt_Goal(self):
#        self.graphScene.graphView.setNodes_StyleStatus(3);
#    def setStatusTypeAct_Normal(self):
#        self.graphScene.graphView.setActions_StyleStatus(0);
#    def setStatusTypeAct_Current(self):
#        self.graphScene.graphView.setActions_StyleStatus(1);
#    def setStatusTypeAct_Risky(self):
#        self.graphScene.graphView.setActions_StyleStatus(2);
#    def setStatusTypeAct_Best(self):
#        self.graphScene.graphView.setActions_StyleStatus(3);